package com.blb.blb_erp;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.blb_erp.entity.SMenu;
import com.blb.blb_erp.entity.SRole;
import com.blb.blb_erp.entity.TProductHandover;
import com.blb.blb_erp.mapper.SMenuMapper;
import com.blb.blb_erp.mapper.SRoleMapper;
import com.blb.blb_erp.mapper.TProductHandoverMapper;
import com.blb.blb_erp.service.ISMenuService;
import com.blb.blb_erp.vo.TreeVO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.time.LocalDateTime;
import java.util.List;

@SpringBootTest
class BlbErpApplicationTests2 {

    @Autowired
//    private SMenuMapper menuMapper;
    private TProductHandoverMapper mapper;

    @Test
    public void testMenuMapper(){
//        List<SMenu> sMenus = menuMapper.selectMenusByUserId("2");
//        List<SMenu> sMenus = menuMapper.selectAllMenus();
//        sMenus.forEach(menu ->{
//            System.out.println("一级菜单：---"+menu.getMenuName());
//            menu.getSubMenus().forEach(sMenu -> System.out.println(sMenu.getMenuName()));
//            System.out.println("_______________________");
//        });
        IPage<TProductHandover> page = new Page<>(1,10);
        //查询条件
        TProductHandover handover = new TProductHandover();
//        handover.setOrderId("159");
        LocalDateTime parse = LocalDateTime.parse("2019-11-15T00:00:00");

//        handover.setHandoverDate(LocalDateTime.of(2019,11,15,0,0));
        handover.setHandoverDate(parse);
        IPage<TProductHandover> handovers = mapper.selectAll(handover,page);
        handovers.getRecords().forEach(h ->{
            System.out.println(h);
        });
    }
}
